package com.fap.search.meta;

import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class MetaRepositoryServlet extends HttpServlet {

	private static final long serialVersionUID = -8559072169565540652L;

	@Override
	public void init() throws ServletException{
		WebApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
		Map<String, MetaRepository> beans = context.getBeansOfType(MetaRepository.class);
		for(String key: beans.keySet()){
			MetaRepository repository = beans.get(key);
			repository.loadAllMeta();
			break;
		}
	}	
}
